<template>
    <appFrame leftText="暂无权限" :showBottom="false">
        <div id="noAccess">
            <span>
                <span>
                    {{ netWorkLink }}
                    <a @click="quitLogin">{{ $t('noAccess.noAccess[1]') }}</a>
                    {{ $t('noAccess.noAccess[4]') }}
                </span>
            </span>
        </div>
    </appFrame>
</template>
<script>
const appFrame = () => import('@/components/appFrame/appFrame.vue')
export default {
    components: { appFrame },
    data: function () {
        return {
            netWorkLink: ''
        }
    },

    // computed: {
    //     loading () {
    //         return this.$store.state.noAccessLoading
    //     },
    //     network () {
    //         return this.$store.state.network
    //     }
    // },
    mounted () {
        let name = this.$route.query.name
        this.netWorkLink =
            name == '2'
                ? this.$t('noAccess.noAccess[3]')
                : this.$t('noAccess.noAccess[0]')
    },
    methods: {
        quitLogin () {
            let code = window.sessionStorage.getItem('iamAccessToken')

            // this.globalVariable.initsEquipAList = {}
            window.sessionStorage.clear()
            sessionStorage.personState = false
            try {
                // eslint-disable-next-line
                myJavaFun.OpenLocalUrl('login')
            } catch (e) {
                if (code == null || code == undefined || code == '') {
                    this.$router.replace('/Login')
                } else {
                    window.location.href = '/loginOut.html'
                }
            }
        }
    }
}
</script>

<style lang="scss" scoped>
#noAccess {
    width: 100%;
    height: 100%;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #bbb;
    a {
        margin: 0 2px;
        color: rgb(17, 112, 230) !important;
    }
}
</style>
